package com.robot.admin.pojo;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.util.Collection;

/**
 * 权限实体类
 * @author william
 */
@Entity
@Table(name="privilege")
public class Privilege {
    @Id
    private String id;
    /**
     * 权限名称
     */
    private String name;

    /**
     * 角色集合
     */
    @ManyToMany(mappedBy = "privileges")
    private Collection<Roles> roles;

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public Collection<Roles> getRoles() {
        return roles;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setRoles(Collection<Roles> roles) {
        this.roles = roles;
    }
}
